<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<%
String path = request.getContextPath();      //上下文路径，/mldn
//请求方式                    服务器名，地址                          端口
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>中秋博饼</title>
		<link rel="stylesheet" href="<%=request.getContextPath()%>/activity/css/style.css" />
		<link rel="stylesheet" href="<%=request.getContextPath()%>/activity/css/bobing.css" />
		<script type="text/javascript" src="<%=request.getContextPath()%>/activity/js/jquery-1.7.2.min.js" ></script>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
	</head>
	<body style="background-image:url(<%=request.getContextPath()%>/images/bobing1.jpg);
        /*background-repeat: no-repeat;*/
        background-size:cover;
          background-color:#9B9B9B;">
		<div class="main">
			<div class="bowl" id="dicebox">
				<img class="bg_img" src="<%=request.getContextPath()%>/activity/img/port.jpg" />
			</div>
		</div>
		
		<div class="btn-box">
			<input class="btn btn-warning"  style="width:150px ;height: 50px;"  type="button" value="开始" onclick="begin()" />
		</div>

		<script type="text/javascript" src="<%=request.getContextPath()%>/activity/js/dice.js" ></script>
		<script>
            //去掉alert域名显示
            window.alert = function(text) {

                //实现alert
                var div = document.createElement("div");
                div.style.backgroundColor = " #22b9ff";
                div.style.color = " #fff";
                div.style.position = " fixed";
                div.style.zIndex = 9999999;
                div.style.height = " 60px";
                div.style.top = " 10%";
                div.style.left = "40%";
                div.style.lineHeight = " 60px";
                div.style.borderRadius = " 4px";
                div.style.fontSize = " 17px";
                div.style.textAlign = "center";
                div.style.padding = "0 10px";
                div.className = "animated  bounceInDown";
                div.id = "alert";
                div.innerHTML = text;
                document.getElementsByTagName("body")[0].appendChild(div);
                var selfObj = document.getElementById("alert");
                //动态调整位置
                var alertWidth = window.getComputedStyle(selfObj, null).width;
                div.style.marginLeft = -parseInt(alertWidth) / 2 + "px";
                setTimeout(function() {
                    document.getElementsByTagName("body")[0].removeChild(div);
                }, 30000);
            }
			function begin(){
				dicefun.init();
			}
		</script>
	</body>
</html>
